<template>
  <div v-for="item of menulist" :key="item.path">
    <a-sub-menu key="sub1" v-if="item.children">
      <template #title>
        <span>
          <user-outlined />
          <span>{{item.title}}</span>
        </span>
      </template>
      <!-- <a-menu-item v-for="itm of item.children" :key="itm.path">{{ itm.title }}</a-menu-item> -->
      <MyMenu :menulist="item.children" />
    </a-sub-menu>
      <a-menu-item v-else :key="item.path" >
      <span>{{ item.title }}</span>
    </a-menu-item>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'

export default {
  props: ['menulist'],
  name: 'MyMenu' // 给组件添加name属性，name属性的值就是你调用的组件的名称
}
</script>
